import { _decorator, CCBoolean, Component, EventHandler, EventTouch, Node } from 'cc';
import { DEV } from 'cc/env';
const { ccclass, property } = _decorator;
@ccclass('SuperCheck')
export class SuperCheck extends Component {
    // @property({ tooltip: DEV && "当鼠标悬停时是否自动选中" })
    // @property(CCBoolean)
    // autoCheckOnHover: boolean = false;

    @property({ tooltip: DEV && "Toggle按钮的点击事件列表" })
    @property([EventHandler])
    checkEvents: EventHandler[] = [];
    private _isChecked: boolean = false;

    @property({ tooltip: DEV && "是否选中" })
    @property(CCBoolean)
    get isChecked() {
        return this._isChecked;
    }
    public set isChecked(checked) {
        this._isChecked = checked;
        if (this.selectedBoxNode) {
            this.selectedBoxNode.active = checked;
        }
    }

    @property({ tooltip: DEV && "选中框" })
    @property(Node)
    selectedBoxNode: Node = null;
}


